function all_sec_id_ok = get_sec_in_same_sector(sector_id)
% Return all securities id in the same sector

all_sec_id = get_info_from_database('security-sector', sector_id);

idx_ok = [];            
med_turnover_pct = [];  

% filter the data w/o null
for i = 1:size(all_sec_id,1)
    rslt = get_info_from_database('daily_stats', 'sec_id', all_sec_id(i));
    if ~isempty(rslt)
        idx_ok = horzcat(idx_ok, i);
        med_turnover_pct = horzcat(med_turnover_pct, rslt.med_turnover_pct);
    end
end

all_sec_id_ok = all_sec_id(idx_ok);
% criteria: medium turnover percentage high
[vals idx] = sort(med_turnover_pct,'descend');
all_sec_id_ok = all_sec_id_ok(idx);

end